import cv2
image=cv2.imread('campus.png')
image_Gray=cv2.cvtColor(image,cv2.COLOR_BGR2GRAY)
t1,dst1=cv2.threshold(image_Gray,127,255,cv2.THRESH_BINARY)
t2,dst2=cv2.threshold(image_Gray,0,255,cv2.THRESH_BINARY+cv2.THRESH_OTSU)
cv2.imshow('Input',image)
cv2.imshow('BINARY',dst1)
cv2.imshow('BINARY-INV',dst2)
cv2.waitKey()
cv2.destroyAllWindows()